﻿using System.Web.Mvc;
using EnetaMvc.ApplicationServices;

namespace EnetaMvc.Web.Controllers
{
    public class TooltipController : BaseController
    {
        private IContentService _contentService;

        public TooltipController(IContentService contentService)
        {
            _contentService = contentService;
        }

        public ActionResult Index(string tipName)
        {
            var tooltip = _contentService.GetTooltipByName(tipName);
            if (tooltip == null)
                return null;

            return Content(tooltip.Content, "text/html");
        }
    }
}
